﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Sys.WebRes.Publish.Areas.Admin.Models.ResourceModel>" %>
<script language="javascript" type="text/javascript">
    //初始化
    $().ready(function () {
        $("#AddSection").click(function () {
            var count = $(".secSign").length;
            var div = $('<div id="sectionInput_' + count + '" class="secSign">');
            $('<select name="Sections[' + count + '].SectionID"></select>').html($("#Sections_0__SectionID").html()).appendTo(div).val(0);
            $('<label>序号</label><input type="text" name="Sections[' + count + '].OrderNo" value=""/>').appendTo(div);
            $('<label>置顶</label><input type="checkbox" name="Sections[' + count + '].TopLevel" value="True" />').appendTo(div);
            $('<input name="Sections[' + count + '].TopLevel" type="hidden" value="false" />').appendTo(div);
            div.appendTo("#SectionTd");
        });
    });
</script>
<tr><td class="editor-label" style="width:60">
    <label for="Name">栏 目</label>
    (<a href="javascript:void(0);" id="AddSection">+</a>)
</td>
<td class="editor-field" id="SectionTd">
    <%for(int i = 0; i < Model.Sections.Count; i++){ %>
        <div id="sectionInput_<%=i %>" class="secSign">
            <%=Html.DropDownListFor(model => model.Sections[i].SectionID, SelectItemFactory.Sections())
            %><label>序号</label><%= 
			Html.TextBoxFor(model => model.Sections[i].OrderNo)%><label>置顶</label><%= 
			Html.CheckBoxFor(model => model.Sections[i].TopLevel)%>
        </div>
    <%} %>
</td>
</tr>